<template>
	<view>
		<view class="person"  >
			<view class="tit">
				<view v-if="currentUser.userName" @click="window.location.href='/h5/personInfo.html'" >
					<view class="userName">
						<view @click="toPersonInfo()" class="h2">{{'HI，'+currentUser.userName}}
							<image mode="widthFix" class="image" style="margin-left: 22rpx;" src="https://m.nocexpo.com/statics/js/modules/h5/img/icon20.png"/>
							<view @tap.stop="toShowRoom(currentUser.id)" v-if="currentUser.type==1&&currentUser.state==1" class="myEnterComp" style="background: #029e9d">
								 我的展厅
							</view>
							<view v-else  class="myEnterComp" style="background: #029e9d" @click.stop.self="enterPersonal(currentUser.id) ">
								个人主页
							</view>
						</view>
		
					</view>
				</view>
				<view class="a" v-else href="/h5/personalInformation.html">
					<view class="h2" >{{currentUser.phone}}
						<image mode="widthFix" src="https://m.nocexpo.com/statics/js/modules/h5/img/icon20.png"/>
					</view>
				</view>
				<view class="ul">
					<view class="position li" >
						<image mode="widthFix" src="https://m.nocexpo.com/statics/js/modules/h5/img/icon25.png"/>
						{{currentUser.position}}
					</view>
					<view class="company li">
						<image mode="widthFix" src="https://m.nocexpo.com/statics/js/modules/h5/img/icon11.png"/>{{currentUser.company}}
					</view>
				</view>
			</view>
			<view class="img" style="border: 1px solid #999;" v-if="currentUser.portrait">
				<view href="/h5/personalInformation.html"><image mode="widthFix" :src="currentUser.portrait"/></view>
			</view>
			<view class="img" style="border: 1px solid #999;" v-else>
				<view href="personalInformation.html"><image mode="widthFix"  style="height: 130rpx;width: 130rpx;" src="/static/image/wutouxiang.png"/></view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	props:[ 'currentUser' ],
	data() {
		return {
			
		}
	},
	methods:{
		toShowRoom(userId){
			uni.navigateTo({
				url:'/pages/product/showroom/showroom?userId='+ userId
			})
		},
		toPersonInfo() {
		  uni.redirectTo({
		    url: '/pages/person/personInfo'
		  })
		},
	}
	
}
</script>

<style>
	.person {
	    overflow: hidden;
	    padding: 75rpx 28rpx 0 28rpx;
	    display: flex;
	    justify-content: space-between;
	    margin-bottom: 21rpx;
	}
	.person .tit {
	    width: 100%;
	    flex-shrink: 1;
	}
	.person .img {
	    flex-shrink: 0;
	    width: 130rpx;
	    height: 130rpx;
	    border-radius: 50%;
	    overflow: hidden;
	}
	.person .tit .h2 {
	    font-size: 34rpx;
	    color: #000000;
	    font-weight: bold;
	    margin-bottom: 37rpx;
	}
	.person .tit .h2 image {
	    display: inline-block;
	    vertical-align: middle;
	    width: 9rpx;
		height: 18rpx;
	}
	.myEnterComp {
	    display: inline-block;
	    height: 37rpx;
	    padding: 0 9rpx;
	    border-radius: 1rpx;
	    text-align: center;
	    font-size: 22rpx;
	    color: #fff;
	    margin: 7rpx 35rpx 0 21rpx;
	}
	.person .tit .ul {
	    overflow: hidden;
	    flex: 0 1 auto;
	    display: flex;
	}
	.person .tit .li.position {
	    color: #207ce9;
	    margin-right: 40rpx;
	    white-space: nowrap;
	}
	.person .tit .li {
	    line-height: 34rpx;
	    font-size: 22rpx;
		display: flex;
	}
	.person .tit .li image {
	    width: 34rpx;
	    height: 34rpx;
	    margin-right: 13rpx;
	}
	
</style>